package com.cr.test;

import com.cr.dao.CustomerDao;
import com.cr.model.Customer;

public class CustomerTest {
	public static void main(String[] args)
	{
		CustomerDao dao=new CustomerDao();
		
		Customer customer=dao.getCustomer(2);
		if(customer!=null)
		{
			System.out.println(customer.getName());
		}
		else
		{
			System.out.println("no such customer");
		}
		customer.setPhone("13996373835");
		
		if(dao.updateCustomer(customer))
		{
			System.out.println("update successfull");
		}
		else
		{
			System.out.println("update failed");
		}
		
//		Customer addC=new Customer();
//		addC.setName("hello");
//		addC.setPassword("123");
//		
//		if(dao.addCustomer(addC))
//		{
//			System.out.println("add successfull");
//		}
//		else
//		{
//			System.out.println("add failed");
//		}
		if(dao.deleteCustomer(1L))
		{
			System.out.println("delete successfull");
		}
		else
		{
			System.out.println("delete failed");
		}
	}
}
